package com.shbt.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TProfessional entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_professional", catalog = "default_schema")
public class TProfessional implements java.io.Serializable {

	// Fields

	private Integer id;
	private TCollege TCollege;
	private String professionalCode;
	private String professionalName;
	private Set<TUser> TUsers = new HashSet<TUser>(0);

	// Constructors

	/** default constructor */
	public TProfessional() {
	}

	/** minimal constructor */
	public TProfessional(Integer id, TCollege TCollege) {
		this.id = id;
		this.TCollege = TCollege;
	}

	/** full constructor */
	public TProfessional(Integer id, TCollege TCollege,
			String professionalCode, String professionalName, Set<TUser> TUsers) {
		this.id = id;
		this.TCollege = TCollege;
		this.professionalCode = professionalCode;
		this.professionalName = professionalName;
		this.TUsers = TUsers;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "t_college_id", nullable = false)
	public TCollege getTCollege() {
		return this.TCollege;
	}

	public void setTCollege(TCollege TCollege) {
		this.TCollege = TCollege;
	}

	@Column(name = "professional_code", length = 20)
	public String getProfessionalCode() {
		return this.professionalCode;
	}

	public void setProfessionalCode(String professionalCode) {
		this.professionalCode = professionalCode;
	}

	@Column(name = "professional_name", length = 20)
	public String getProfessionalName() {
		return this.professionalName;
	}

	public void setProfessionalName(String professionalName) {
		this.professionalName = professionalName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TProfessional")
	public Set<TUser> getTUsers() {
		return this.TUsers;
	}

	public void setTUsers(Set<TUser> TUsers) {
		this.TUsers = TUsers;
	}

}